package com.lzx.applib.anim;

import android.view.View;
import android.view.animation.Animation;

/**
 * Created by Lzx on 16/11/18 0018.
 */

public class ViewVisibleAnimation implements Animation.AnimationListener {

    View view;
    int visibleBefore;
    int visibleAfter;

    public ViewVisibleAnimation(View view, int visibleBefore, int visibleAfter) {
        this.view = view;
        this.visibleBefore = visibleBefore;
        this.visibleAfter = visibleAfter;
    }

    @Override
    public void onAnimationStart(Animation animation) {
        view.setVisibility(visibleBefore);
    }

    @Override
    public void onAnimationEnd(Animation animation) {
        view.setVisibility(visibleAfter);
    }

    @Override
    public void onAnimationRepeat(Animation animation) {
    }
}